/*
-----------------------------------------------------------------------------
This source file is part of Labor3D
(Labor 3D Graphics Engine)

Copyright (c) 2009-2020 Rock Mao
* creator : Rock Mao
* created : 2009-9-21   20:29
* filename: LaborApp.h
-----------------------------------------------------------------------------
*/

#ifndef __LABORAPP_H__
#define __LABORAPP_H__
#include "LaborCoreDef.h"
#include <windows.h>

NAMESPACE_LABOR3D_BEGIN

enum eLAppState
{
	eLAppState_NotInited = 0,
	eLAppState_Initialize = 1,
	eLAppState_Running  = 2,
	eLAppState_Pause    = 3,
	eLAppState_Exit     = 4,
};

class  LABORCORE_API ILApp
{
	static ILApp* m_pSingleton;
protected:
	eLAppState       m_appState;
	ILApp();
public :
	static ILApp*  getInstance() ; // application must be a single-ton

	eLAppState   state(){return m_appState ; }
	void            setState(eLAppState st) {m_appState = st ; }
	void            exitApplication(){m_appState = eLAppState_Exit ; }

public:
	//virtual function . sub-class can override or overload this function

	virtual void            onEvent(MSG& msg) = 0;
	virtual bool            updateFrame(int passedTime) = 0;


};

NAMESPACE_LABOR3D_END
#endif